<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>WB32L003 Standard Peripherals Firmware Library: wb32l003_flash.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">WB32L003 Standard Peripherals Firmware Library
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_6d2d5b60bd20db849a9486835a2715aa.html">Libraries</a></li><li class="navelem"><a class="el" href="dir_5ec8cccc32fa528457f3b4ed28e1a2cf.html">WB32L003_StdPeriph_Driver</a></li><li class="navelem"><a class="el" href="dir_cb9a941ec225bfb9bad4e8246158e282.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">wb32l003_flash.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="wb32l003__flash_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">/* Define to prevent recursive inclusion -------------------------------------*/</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifndef __WB32L003_FLASH_H</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#define __WB32L003_FLASH_H</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">/* Includes ------------------------------------------------------------------*/</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;wb32l003.h&quot;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment">/* Exported types ------------------------------------------------------------*/</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">   34</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">enum</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;{ </div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;  FLASH_BUSY = 1,</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;  FLASH_ERROR_ERPC,</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;  FLASH_ERROR_ERPROT,</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;  FLASH_COMPLETE,</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;  FLASH_TIMEOUT</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;} <a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a>;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">/* Exported constants --------------------------------------------------------*/</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#define FLASH_TIMEOUT_VALUE                    50000U</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="preprocessor">#define FLASH_REGUNLOCK_KEY1                   0x5A5A</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="preprocessor">#define FLASH_REGUNLOCK_KEY2                   0xA5A5</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="group___f_l_a_s_h___flag__definition.html#ga67290b307a772b4c57dccd0227ae17f1">   64</a></span>&#160;<span class="preprocessor">#define FLASH_FLAG_BUSY                        FLASH_CR_BUSY </span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="group___f_l_a_s_h___interrupt__definition.html#ga216f441000eb48a3f0955a445f4e7569">   73</a></span>&#160;<span class="preprocessor">#define FLASH_IT_ALARM_ERASE_PROTADDR         (FLASH_IFR_IF1 | FLASH_CR_IE_1) </span></div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="group___f_l_a_s_h___interrupt__definition.html#ga8ebb896fb43b67b5938d1948171400d9">   74</a></span>&#160;<span class="preprocessor">#define FLASH_IT_ALARM_ERASE_PCADDR           (FLASH_IFR_IF0 | FLASH_CR_IE_0) </span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#define FLASH_PAGE_SIZE                        0x200U</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">#define FLASH_SIZE_32K                         0x8000U</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#define FLASH_SIZE_64K                         0x10000U</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;<span class="preprocessor">#define FLASH_ALLPAGE_SELECTED                 0xFFFFFFFFU</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="comment">/* Exported macro ------------------------------------------------------------*/</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="comment">/* Exported functions --------------------------------------------------------*/</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___f_l_a_s_h.html#gacaff2d6333c831e1f2f2fb1e4be5bc35">FLASH_OP_Unlock</a>(uint32_t PageAddr);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___f_l_a_s_h.html#gad8eda1dd6e3928e88c40e2a1e54bac64">FLASH_OP_Lock</a>(uint32_t PageAddr);</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___f_l_a_s_h.html#ga4084d0184bab463a1579271bf474aaef">FLASH_Unlock</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___f_l_a_s_h.html#ga46899557353c4312ddbe3f25e65df1d8">FLASH_Lock</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___f_l_a_s_h.html#ga94c1e51a9c3bf8d48eb6eb4a4d054861">FLASH_ITConfig</a>(uint32_t FLASH_IT, FunctionalState NewState);</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___f_l_a_s_h.html#gabdabeceeb7c2b03a55da23464ed03cf7">FLASH_ClearITPendingBit</a>(uint32_t FLASH_IT);</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;FlagStatus <a class="code" href="group___f_l_a_s_h.html#ga54f590d613cea8f3147c76a07fcccb24">FLASH_GetITStatus</a>(uint32_t Flag);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;FlagStatus <a class="code" href="group___f_l_a_s_h.html#ga272a03dfca95d60ff6b5b28cd7d532c5">FLASH_GetFlagStatus</a>(uint32_t Flag);</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a> <a class="code" href="group___f_l_a_s_h.html#ga2ad803999ae93ec03700983c59cae264">FLASH_WaitForLastOperation</a>(uint32_t Timeout);</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a> <a class="code" href="group___f_l_a_s_h.html#ga83107c4faee4e675e1a021c2530c9970">FLASH_ProgramByte</a>(uint32_t Addr, uint8_t Data);</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;<a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a> <a class="code" href="group___f_l_a_s_h.html#gad53043f7548575b094741497d9a54eb1">FLASH_ProgramHalfWord</a>(uint32_t Addr, uint16_t Data);</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;<a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a> <a class="code" href="group___f_l_a_s_h.html#gac2d3631c3b2ce41eba346ce71c922424">FLASH_ProgramWord</a>(uint32_t Addr, uint32_t Data);</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;<a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a> <a class="code" href="group___f_l_a_s_h.html#ga86ffd9e8dc00f2cde1e1ae767803447a">FLASH_EraseChip</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;<a class="code" href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a> <a class="code" href="group___f_l_a_s_h.html#ga13cd893db6616373129eaae80949fa4d">FLASH_ErasePage</a>(uint32_t PageAddr);</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;}</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/*__WB32L003_FLASH_H */</span><span class="preprocessor"></span></div><div class="ttc" id="group___f_l_a_s_h_html_ga2ad803999ae93ec03700983c59cae264"><div class="ttname"><a href="group___f_l_a_s_h.html#ga2ad803999ae93ec03700983c59cae264">FLASH_WaitForLastOperation</a></div><div class="ttdeci">FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout)</div><div class="ttdoc">Wait for a FLASH operation to complete.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:275</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga94c1e51a9c3bf8d48eb6eb4a4d054861"><div class="ttname"><a href="group___f_l_a_s_h.html#ga94c1e51a9c3bf8d48eb6eb4a4d054861">FLASH_ITConfig</a></div><div class="ttdeci">void FLASH_ITConfig(uint32_t FLASH_IT, FunctionalState NewState)</div><div class="ttdoc">Enables or disables the specified FLASH interrupts.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:194</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga86ffd9e8dc00f2cde1e1ae767803447a"><div class="ttname"><a href="group___f_l_a_s_h.html#ga86ffd9e8dc00f2cde1e1ae767803447a">FLASH_EraseChip</a></div><div class="ttdeci">FLASH_Status FLASH_EraseChip(void)</div><div class="ttdoc">Full erase of FLASH memory Bank.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:421</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_gabdabeceeb7c2b03a55da23464ed03cf7"><div class="ttname"><a href="group___f_l_a_s_h.html#gabdabeceeb7c2b03a55da23464ed03cf7">FLASH_ClearITPendingBit</a></div><div class="ttdeci">void FLASH_ClearITPendingBit(uint32_t FLASH_IT)</div><div class="ttdoc">Clear the specified FLASH interrupt flag.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:218</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_gad8eda1dd6e3928e88c40e2a1e54bac64"><div class="ttname"><a href="group___f_l_a_s_h.html#gad8eda1dd6e3928e88c40e2a1e54bac64">FLASH_OP_Lock</a></div><div class="ttdeci">void FLASH_OP_Lock(uint32_t PageAddr)</div><div class="ttdoc">Unlock the FLASH Page Erase/Write access.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:108</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga4084d0184bab463a1579271bf474aaef"><div class="ttname"><a href="group___f_l_a_s_h.html#ga4084d0184bab463a1579271bf474aaef">FLASH_Unlock</a></div><div class="ttdeci">void FLASH_Unlock(void)</div><div class="ttdoc">Unlock the FLASH controller register write-protect.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:149</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga13cd893db6616373129eaae80949fa4d"><div class="ttname"><a href="group___f_l_a_s_h.html#ga13cd893db6616373129eaae80949fa4d">FLASH_ErasePage</a></div><div class="ttdeci">FLASH_Status FLASH_ErasePage(uint32_t PageAddr)</div><div class="ttdoc">Erase the specified FLASH memory page.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:463</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_gac2d3631c3b2ce41eba346ce71c922424"><div class="ttname"><a href="group___f_l_a_s_h.html#gac2d3631c3b2ce41eba346ce71c922424">FLASH_ProgramWord</a></div><div class="ttdeci">FLASH_Status FLASH_ProgramWord(uint32_t Addr, uint32_t Data)</div><div class="ttdoc">Program a word (32-bit) at a specified address.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:380</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga272a03dfca95d60ff6b5b28cd7d532c5"><div class="ttname"><a href="group___f_l_a_s_h.html#ga272a03dfca95d60ff6b5b28cd7d532c5">FLASH_GetFlagStatus</a></div><div class="ttdeci">FlagStatus FLASH_GetFlagStatus(uint32_t Flag)</div><div class="ttdoc">Checks whether the specified FLASH flag is set or not.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:255</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_gad53043f7548575b094741497d9a54eb1"><div class="ttname"><a href="group___f_l_a_s_h.html#gad53043f7548575b094741497d9a54eb1">FLASH_ProgramHalfWord</a></div><div class="ttdeci">FLASH_Status FLASH_ProgramHalfWord(uint32_t Addr, uint16_t Data)</div><div class="ttdoc">Program a half-word (16-bit) at a specified address.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:338</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga46899557353c4312ddbe3f25e65df1d8"><div class="ttname"><a href="group___f_l_a_s_h.html#ga46899557353c4312ddbe3f25e65df1d8">FLASH_Lock</a></div><div class="ttdeci">void FLASH_Lock(void)</div><div class="ttdoc">Lock the FLASH controller register write-protect.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:170</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_gadc63a6f3404ff1f71229a66915e9cdc0"><div class="ttname"><a href="group___f_l_a_s_h.html#gadc63a6f3404ff1f71229a66915e9cdc0">FLASH_Status</a></div><div class="ttdeci">FLASH_Status</div><div class="ttdoc">FLASH Status.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.h:34</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_gacaff2d6333c831e1f2f2fb1e4be5bc35"><div class="ttname"><a href="group___f_l_a_s_h.html#gacaff2d6333c831e1f2f2fb1e4be5bc35">FLASH_OP_Unlock</a></div><div class="ttdeci">void FLASH_OP_Unlock(uint32_t PageAddr)</div><div class="ttdoc">Lock the FLASH Page Erase/Write access.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:66</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga54f590d613cea8f3147c76a07fcccb24"><div class="ttname"><a href="group___f_l_a_s_h.html#ga54f590d613cea8f3147c76a07fcccb24">FLASH_GetITStatus</a></div><div class="ttdeci">FlagStatus FLASH_GetITStatus(uint32_t Flag)</div><div class="ttdoc">Checks whether the specified FLASH interrupt has occurred or not.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:233</div></div>
<div class="ttc" id="group___f_l_a_s_h_html_ga83107c4faee4e675e1a021c2530c9970"><div class="ttname"><a href="group___f_l_a_s_h.html#ga83107c4faee4e675e1a021c2530c9970">FLASH_ProgramByte</a></div><div class="ttdeci">FLASH_Status FLASH_ProgramByte(uint32_t Addr, uint8_t Data)</div><div class="ttdoc">Program a byte (8-bit) at a specified address.</div><div class="ttdef"><b>Definition:</b> wb32l003_flash.c:296</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by Westberry Technology (ChangZhou) Corp., Ltd. All rights reserved.
</small></address>
</body>
</html>
